import request from "../request.js"
import listUtils from "@/utils/ListUtils.js"
/**
 *  消息相关的请求接口
 */
const token = uni.getStorageSync('token');
export default {
	//关注用户
	follow(userId) {
		return request("/follow/follow/"+userId, "POST")
	},
	
	//取消关注
	cancelFollow(userId) {
		return request("/follow/cancelFollow/"+userId, "POST")
	},
	
	//根据用户id，查询他的关注数、粉丝数
	followFansNum(userId) {
		return request("/follow/followFansNum/"+userId, "GET")
	},
	
	//根据用户id。分页查询该用户的粉丝列表
	listFans(userId,page){
		return request("/follow/fans/list/"+userId, "POST",page)
	},
	
	//根据用户id。分页查询该用户的关注列表
	listFollows(userId,page){
		return request("/follow/follows/list/"+userId, "POST",page)
	},
	
	//根据用户id。分页查询该用户的关注列表
	isFollow(userId){
		return request("/follow/isFollow/"+userId, "GET")
	},
	
	//批量查询当前用户是否已关注了另一批用户
	batchQueryIsFollow(ids){
		return request("/follow/batch/isFollow", "POST",listUtils.removeRepeat(ids))
	}
}
